package com.hzyl.famousreader.view.adapter;

import android.support.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hzyl.famousreader.R;
import com.hzyl.famousreader.repository.persistence.entity.Book;
import com.hzyl.famousreader.view.DataBindingAdapter;

import java.util.List;

/**
 * 书架
 */
public class BookshelfAdapter extends BaseQuickAdapter<Book, BaseViewHolder> {

  public BookshelfAdapter(@Nullable List<Book> data) {
    super(R.layout.item_book, data);
  }

  @Override
  protected void convert(BaseViewHolder helper, Book item) {
    DataBindingAdapter.glideImg(helper.getView(R.id.book_cover), item.getCover());
    helper.setText(R.id.book_name, item.getName());
  }
}
